home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1998-06-24 | 2.9 KB | 167 lines |
- G4C
-
- winbig -1 -1 240 113 ""
- wintype 11010001
- usetopaz
- varpath "hlpvwr.g/climaster"
-
- xonload
- guide = "cmst:CLIMaster.guide"
- guiopen cmhelp.g
-
- xonopen
- lvuse cmhelp.g 1
- run 'resident cmst:bin/writenode pure add'
- cli 'cmst:bin/getnodes $guide cmst:config/climaster.guide.idx'
- lvchange cmst:config/climaster.guide.idx
- lvdel 0
- extract guide file wtitle
- extract wtitle unquote wtitle
- setwintitle cmhelp.g "$wtitle "
-
- xonkey #v
- xonkey #r
- if $$rawkey.code = 78
- lvuse cmhelp.g 1
- lvmove 1
- elseif $$rawkey.code = 79
- lvuse cmhelp.g 1
- lvmove -1
- endif
-
- xonclose
- gosub cmhelp.g exit
-
- xtextin 0 0 220 13 "" txt "" 80
- if $txt > ''
- lvuse cmhelp.g 1
- lvsearch $txt ci first
- endif
- gosub cmhelp.g search_update
-
- xbutton 220 0 20 13 ยป
- if $txt > ''
- lvuse cmhelp.g 1
- lvsearch $txt ci next
- endif
- gosub cmhelp.g search_update
-
- xlistview 0 13 240 100 '' topic '' 0 txt
- gadid 1
- gosub cmhelp.g fetchtext
-
- xroutine fetchtext
- cutvar topic cut word -2 offset
- extract topic upper topic
- extract topic unquote topic
- cli 'writenode $guide $offset'
- ifexists window hlpvwr.g
- guiwindow hlpvwr.g front
- guiwindow hlpvwr.g on
- else
- guiopen hlpvwr.g
- endif
- gosub hlpvwr.g switchgads
- update hlpvwr.g 2 "Subject: $topic"
- set translation off
- lvuse hlpvwr.g 1
- lvchange ram:guide.txt
-
- xroutine search_update
- if $$lv.line > ''
- update cmhelp.g 1 $$lv.line
- else
- lvgo #0
- update cmhelp.g 1 0
- endif
-
- xroutine exit
- run 'resident writenode remove'
- ifexists file ram:guide.txt
- delete ram:guide.txt
- endif
- lvuse climaster $cm_srce
- guiquit hlpvwr.g
- guiquit cmhelp.g
-
- ;--------------------------------------------------------------
-
- newfile hlpvwr.g
-
- winbig -1 -1 600 192 "CLIMaster Help System"
- winsmall 0 -1 600 192
- wintype 11110001
- varpath "cmhelp.g"
-
- xonclose
- set translation on
- lvuse hlpvwr.g 1
- lvclear
- gosub cmhelp.g exit
-
- xonrmb
- set translation on
- lvuse hlpvwr.g 1
- lvclear
- ifexists window cmhelp.g
- update hlpvwr.g 2 ""
- guiwindow cmhelp.g front
- guiwindow cmhelp.g on
- else
- guiclose hlpvwr.g
- endif
-
- box 0 0 450 12 out button
-
- xlistview 0 12 0 180 "" "" "" 20 num
- gadid 1
- gadfont topaz.font 8 000
-
- text 10 0 450 12 "" 50 nobox
- gadid 2
-
- xbutton 450 0 50 12 Prev
- gadid 4
- lvuse cmhelp.g 1
- if $$lv.line != 0
- setgad hlpvwr.g 4 on
- setgad hlpvwr.g 5 on
- lvgo prev
- topic = $$lv.rec
- gosub hlpvwr.g switchgads
- gosub cmhelp.g fetchtext
- endif
-
- xbutton 500 0 50 12 Next
- gadid 5
- lvuse cmhelp.g 1
- if $$lv.line != $total
- setgad hlpvwr.g 4 on
- setgad hlpvwr.g 5 on
- lvgo next
- topic = $$lv.rec
- gosub hlpvwr.g switchgads
- gosub cmhelp.g fetchtext
- endif
-
- xbutton 550 0 50 12 Quit
- guiclose hlpvwr.g
-
- xroutine switchgads
- lvuse cmhelp.g 1
- total = $$lv.total
- counter total dec 1
- if $$lv.line = 0
- setgad hlpvwr.g 4 off
- setgad hlpvwr.g 5 on
- return
- elseif $$lv.line = $total
- setgad hlpvwr.g 4 on
- setgad hlpvwr.g 5 off
- return
- else
- setgad hlpvwr.g 4 on
- setgad hlpvwr.g 5 on
- return
- endif
-